import React, { Component } from "react";
import { highquality, topList } from "../../api/playlists";
export default class Playlists extends Component {
  constructor(props) {
    super();
    this.state = {
      // 选中分类索引
      selectIndex: 0,
      cats: [
        "全部",
        "欧美",
        "华语",
        "流行",
        "说唱",
        "摇滚",
        "民谣",
        "电子",
        "轻音乐",
        "影视原声",
        "ACG",
        "怀旧",
        "治愈",
        "旅行",
      ],
    };
  }
  componentDidMount() {
    this.loadHighquality();
  }
  async loadHighquality() {
    const res = await highquality({
      cat: this.state.cats[this.state.selectIndex],
    });
    const { code, playlists } = res.data;
    if (code === 200) {
      console.log(res);
    }
  }
  render() {
    return <div>最新音乐</div>;
  }
}
